package com.mama100.rpc.mdp;

import com.mama100.common.finagle.util.RpcUtil;
import com.mama100.rpc.mdp.constant.ResponseCode;
import com.mama100.rpc.mdp.thrift.inout.*;
import com.mama100.rpc.mdp.thrift.inout.common.*;

import com.mama100.rpc.mdp.bean.*;

public class MdpInoutUtil {

    public static BaseResponse getBaseResponse(String seqNo) {
        BaseResponse baseResp = new BaseResponse();
        baseResp.setRespCode(ResponseCode.SUCCESS.getCode());
        baseResp.setRespDesc(ResponseCode.SUCCESS.getDesc());
        if (seqNo == null) {
            baseResp.setSeqNo(RpcUtil.genSeqNo());
        } else {
            baseResp.setSeqNo(seqNo);
        }
        return baseResp;
    }

    public static BaseRequest getBaseRequest(String seqNo) {
        BaseRequest req = new BaseRequest();
        if (seqNo == null) {
            req.setSeqNo(RpcUtil.genSeqNo());
        } else {
            req.setSeqNo(seqNo);
        }
        return req;
    }

    public static BindCustBrandRequest getBindCustBrandRequest(String seqNo) {
        BindCustBrandRequest req = new BindCustBrandRequest();
        req.setBaseReq(getBaseRequest(seqNo));
        return req;
    }

    public static UnBindCustBrandRequest getUnBindCustBrandRequest(String seqNo) {
        UnBindCustBrandRequest req = new UnBindCustBrandRequest();
        req.setBaseReq(getBaseRequest(seqNo));
        return req;
    }

    public static GetCustBrandRequest getGetCustBrandRequest(String seqNo) {
        GetCustBrandRequest req = new GetCustBrandRequest();
        req.setBaseReq(getBaseRequest(seqNo));
        return req;
    }

    public static BindCustTerminalRequest getBindCustTerminalRequest(String seqNo) {
        BindCustTerminalRequest req = new BindCustTerminalRequest();
        req.setBaseReq(getBaseRequest(seqNo));
        return req;
    }

    public static UnBindCustTerminalRequest getUnBindCustTerminalRequest(String seqNo) {
        UnBindCustTerminalRequest req = new UnBindCustTerminalRequest();
        req.setBaseReq(getBaseRequest(seqNo));
        return req;
    }

    public static GetCustTerminalRequest getGetCustTerminalRequest(String seqNo) {
        GetCustTerminalRequest req = new GetCustTerminalRequest();
        req.setBaseReq(getBaseRequest(seqNo));
        return req;
    }

    public static GetCustTerminalByTerminalCodeRequest getGetCustTerminalByTerminalCodeRequest(String seqNo) {
        GetCustTerminalByTerminalCodeRequest req = new GetCustTerminalByTerminalCodeRequest();
        req.setBaseReq(getBaseRequest(seqNo));
        return req;
    }

    public static GetCustPointBatchRequest getGetCustPointBatchRequest(String seqNo) {
        GetCustPointBatchRequest req = new GetCustPointBatchRequest();
        req.setBaseReq(getBaseRequest(seqNo));
        return req;
    }

    public static GetOrderReportRequest getGetOrderReportRequest(String seqNo) {
        GetOrderReportRequest req = new GetOrderReportRequest();
        req.setBaseReq(getBaseRequest(seqNo));
        return req;
    }

    public static GetTCustBelongTerminalRequest getGetTCustBelongTerminalRequest(String seqNo) {
        GetTCustBelongTerminalRequest req = new GetTCustBelongTerminalRequest();
        req.setBaseReq(getBaseRequest(seqNo));
        return req;
    }

    public static GetTCustBelongByCustomerIdRequest getGetTCustBelongByCustomerIdRequest(String seqNo) {
        GetTCustBelongByCustomerIdRequest req = new GetTCustBelongByCustomerIdRequest();
        req.setBaseReq(getBaseRequest(seqNo));
        return req;
    }

    public static GetTCustBelongByTerminalCodeRequest getGetTCustBelongByTerminalCodeRequest(String seqNo) {
        GetTCustBelongByTerminalCodeRequest req = new GetTCustBelongByTerminalCodeRequest();
        req.setBaseReq(getBaseRequest(seqNo));
        return req;
    }

    public static GetAggregateCommissionRequest getGetAggregateCommissionRequest(String seqNo) {
        GetAggregateCommissionRequest req = new GetAggregateCommissionRequest();
        req.setBaseReq(getBaseRequest(seqNo));
        return req;
    }

    public static GetCommissionDetailsRequest getGetCommissionDetailsRequest(String seqNo) {
        GetCommissionDetailsRequest req = new GetCommissionDetailsRequest();
        req.setBaseReq(getBaseRequest(seqNo));
        return req;
    }

    public static GetCommissionDetailByIdRequest getGetCommissionDetailByIdRequest(String seqNo) {
        GetCommissionDetailByIdRequest req = new GetCommissionDetailByIdRequest();
        req.setBaseReq(getBaseRequest(seqNo));
        return req;
    }

    public static BoolResponse getBoolResponse(String seqNo) {
        BoolResponse resp = new BoolResponse();
        BaseResponse baseResp = getBaseResponse(seqNo);
        resp.setBaseResp(baseResp);
        return resp;
    }

    public static I64Response getI64Response(String seqNo) {
        I64Response resp = new I64Response();
        BaseResponse baseResp = getBaseResponse(seqNo);
        resp.setBaseResp(baseResp);
        return resp;
    }

    public static I32Response getI32Response(String seqNo) {
        I32Response resp = new I32Response();
        BaseResponse baseResp = getBaseResponse(seqNo);
        resp.setBaseResp(baseResp);
        return resp;
    }

    public static StringResponse getStringResponse(String seqNo) {
        StringResponse resp = new StringResponse();
        BaseResponse baseResp = getBaseResponse(seqNo);
        resp.setBaseResp(baseResp);
        return resp;
    }

    public static VoidResponse getVoidResponse(String seqNo) {
        VoidResponse resp = new VoidResponse();
        BaseResponse baseResp = getBaseResponse(seqNo);
        resp.setBaseResp(baseResp);
        return resp;
    }

    public static GetCustBrandResponse getGetCustBrandResponse(String seqNo) {
        GetCustBrandResponse resp = new GetCustBrandResponse();
        BaseResponse baseResp = getBaseResponse(seqNo);
        resp.setBaseResp(baseResp);
        return resp;
    }

    public static GetCustTerminalResponse getGetCustTerminalResponse(String seqNo) {
        GetCustTerminalResponse resp = new GetCustTerminalResponse();
        BaseResponse baseResp = getBaseResponse(seqNo);
        resp.setBaseResp(baseResp);
        return resp;
    }

    public static GetCustTerminalByTerminalCodeResponse getGetCustTerminalByTerminalCodeResponse(String seqNo) {
        GetCustTerminalByTerminalCodeResponse resp = new GetCustTerminalByTerminalCodeResponse();
        BaseResponse baseResp = getBaseResponse(seqNo);
        resp.setBaseResp(baseResp);
        return resp;
    }

    public static GetCustPointBatchResponse getGetCustPointBatchResponse(String seqNo) {
        GetCustPointBatchResponse resp = new GetCustPointBatchResponse();
        BaseResponse baseResp = getBaseResponse(seqNo);
        resp.setBaseResp(baseResp);
        return resp;
    }

    public static GetOrderReportResponse getGetOrderReportResponse(String seqNo) {
        GetOrderReportResponse resp = new GetOrderReportResponse();
        BaseResponse baseResp = getBaseResponse(seqNo);
        resp.setBaseResp(baseResp);
        return resp;
    }

    public static GetTCustBelongByCustomerIdResponse getGetTCustBelongByCustomerIdResponse(String seqNo) {
        GetTCustBelongByCustomerIdResponse resp = new GetTCustBelongByCustomerIdResponse();
        BaseResponse baseResp = getBaseResponse(seqNo);
        resp.setBaseResp(baseResp);
        return resp;
    }

    public static GetTCustBelongByTerminalCodeResponse getGetTCustBelongByTerminalCodeResponse(String seqNo) {
        GetTCustBelongByTerminalCodeResponse resp = new GetTCustBelongByTerminalCodeResponse();
        BaseResponse baseResp = getBaseResponse(seqNo);
        resp.setBaseResp(baseResp);
        return resp;
    }

    public static GetAggregateCommissionResponse getGetAggregateCommissionResponse(String seqNo) {
        GetAggregateCommissionResponse resp = new GetAggregateCommissionResponse();
        BaseResponse baseResp = getBaseResponse(seqNo);
        resp.setBaseResp(baseResp);
        return resp;
    }

    public static GetCommissionDetailsResponse getGetCommissionDetailsResponse(String seqNo) {
        GetCommissionDetailsResponse resp = new GetCommissionDetailsResponse();
        BaseResponse baseResp = getBaseResponse(seqNo);
        resp.setBaseResp(baseResp);
        return resp;
    }

    public static GetCommissionDetailByIdResponse getGetCommissionDetailByIdResponse(String seqNo) {
        GetCommissionDetailByIdResponse resp = new GetCommissionDetailByIdResponse();
        BaseResponse baseResp = getBaseResponse(seqNo);
        resp.setBaseResp(baseResp);
        return resp;
    }

    public static CustBrand mapCustBrand(TCustBrand value) {
        CustBrand result = new CustBrand();

        if (value.isSetCustomerId()) {
            result.setCustomerId(value.getCustomerId());
        }

        if (value.isSetBrandId()) {
            result.setBrandId(value.getBrandId());
        }

        if (value.isSetUpdateTime()) {
            result.setUpdateTime(value.getUpdateTime());
        }

        if (value.isSetUpdateBy()) {
            result.setUpdateBy(value.getUpdateBy());
        }

        if (value.isSetFromSystem()) {
            result.setFromSystem(value.getFromSystem());
        }

        return result;
    }

    public static CustTerminal mapCustTerminal(TCustTerminal value) {
        CustTerminal result = new CustTerminal();

        if (value.isSetCustomerId()) {
            result.setCustomerId(value.getCustomerId());
        }

        if (value.isSetTerminalCode()) {
            result.setTerminalCode(value.getTerminalCode());
        }

        if (value.isSetUpdateTime()) {
            result.setUpdateTime(value.getUpdateTime());
        }

        if (value.isSetUpdateBy()) {
            result.setUpdateBy(value.getUpdateBy());
        }

        if (value.isSetFromSystem()) {
            result.setFromSystem(value.getFromSystem());
        }

        return result;
    }

    public static CustPoint mapCustPoint(TCustPoint value) {
        CustPoint result = new CustPoint();

        if (value.isSetId()) {
            result.setId(value.getId());
        }

        if (value.isSetName()) {
            result.setName(value.getName());
        }

        if (value.isSetProductName()) {
            result.setProductName(value.getProductName());
        }

        if (value.isSetPoint()) {
            result.setPoint(value.getPoint());
        }

        if (value.isSetPointType()) {
            result.setPointType(value.getPointType());
        }

        if (value.isSetCreatedBySystem()) {
            result.setCreatedBySystem(value.getCreatedBySystem());
        }

        if (value.isSetPointStatus()) {
            result.setPointStatus(value.getPointStatus());
        }

        if (value.isSetRegisterDate()) {
            result.setRegisterDate(value.getRegisterDate());
        }

        return result;
    }

    public static CustBelong mapCustBelong(TCustBelong value) {
        CustBelong result = new CustBelong();

        if (value.isSetCustomerId()) {
            result.setCustomerId(value.getCustomerId());
        }

        if (value.isSetTerminalCode()) {
            result.setTerminalCode(value.getTerminalCode());
        }

        if (value.isSetFromType()) {
            result.setFromType(value.getFromType());
        }

        if (value.isSetFromSystem()) {
            result.setFromSystem(value.getFromSystem());
        }

        if (value.isSetCreatedTime()) {
            result.setCreatedTime(value.getCreatedTime());
        }

        if (value.isSetExpiryTime()) {
            result.setExpiryTime(value.getExpiryTime());
        }

        if (value.isSetUpdatedTime()) {
            result.setUpdatedTime(value.getUpdatedTime());
        }

        return result;
    }

    public static CommissionDetail mapCommissionDetail(TCommissionDetail value) {
        CommissionDetail result = new CommissionDetail();

        if (value.isSetId()) {
            result.setId(value.getId());
        }

        if (value.isSetCustomerName()) {
            result.setCustomerName(value.getCustomerName());
        }

        if (value.isSetCommissionCharge()) {
            result.setCommissionCharge(value.getCommissionCharge());
        }

        if (value.isSetBankDesc()) {
            result.setBankDesc(value.getBankDesc());
        }

        if (value.isSetCardLast4()) {
            result.setCardLast4(value.getCardLast4());
        }

        if (value.isSetOrderId()) {
            result.setOrderId(value.getOrderId());
        }

        if (value.isSetTerminalName()) {
            result.setTerminalName(value.getTerminalName());
        }

        if (value.isSetOrderCharge()) {
            result.setOrderCharge(value.getOrderCharge());
        }

        if (value.isSetOrderTime()) {
            result.setOrderTime(value.getOrderTime());
        }

        if (value.isSetCommissionTime()) {
            result.setCommissionTime(value.getCommissionTime());
        }

        if (value.isSetTransferTime()) {
            result.setTransferTime(value.getTransferTime());
        }

        if (value.isSetSettleType()) {
            result.setSettleType(value.getSettleType());
        }

        if (value.isSetOrderType()) {
            result.setOrderType(value.getOrderType());
        }

        return result;
    }

    public static Commission mapCommission(TCommission value) {
        Commission result = new Commission();

        if (value.isSetPaidCommission()) {
            result.setPaidCommission(value.getPaidCommission());
        }

        if (value.isSetUnpaidCommission()) {
            result.setUnpaidCommission(value.getUnpaidCommission());
        }

        if (value.isSetTotalCommission()) {
            result.setTotalCommission(value.getTotalCommission());
        }

        return result;
    }

}